import pysolr



if __name__ == '__main__':
    zookeeper = pysolr.ZooKeeper("CDH-master:2181,CDH-slave1:2181,CDH-slave2:2181/solr")
    solr_con =  pysolr.SolrCloud(zookeeper,"hbaseSolr")
    results = solr_con.search("id:*")
    print("Saw {0} result(s).".format(len(results)))
    for result in results:
        print('id:{}'.format(result['id']))
        print('"name":"{}"'.format(result['name']))
        print('"city":"{}"'.format(result['city']))
        print('"salary":"{}"'.format(result['salary']))
        print('-------------------------------------')